<include file="../Public/header" />
<link href="{:APPS_URL}/w3g/_static/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
  body{background-color: #f8f8f8;}
</style>

<script type="text/javascript" src="__THEME__/js/module.weibo.js"></script> 

<div id="content">
    <div id="weiba" data-title="引用回复帖子" class="panel" data-selected="true"  data-menu="msgmenu">
        <header>
            <div id="header-buttons">
                <a href="javascript:history.go(-1);">
                    <div id="back" class="header-menu-link" data-back="false">
                    </div>
                </a>

                <div id="messageLink" class="header-menu-link"><a href="{:U('w3g/Index/msgbox')}"><i class="num"></i></a></div>
        <div id="menuLink" class="header-menu-link"></div>
            </div>
            <h1 class="hasback">
                引用回复帖子
            </h1>
        </header>
  <div class="weibaPost"> 
    
    <!-- 回复 begin-->
    <php>if($topic['lock'] == 0 && $mid){</php>
    <form method="post" action="{:U('w3g/Group/topic_reply')}" id="replyForm" enctype="multipart/form-data">
      <div class="border">
        <dl class="formBox">
          <dd class="re_quote"><span>引用:</span>
            <div class="t">{$quote.content|t|parse_html|getShort=100}</div>
          </dd>
          <dd>
            <div class="re_box"  model-node="mini_editor">
              <input type="hidden" name="gid" value="{$gid}">
              <input type="hidden" name="tid" value="{$tid}">
              <input type="hidden" id="qid" name="qid" value="{$qid}">
              <input type="hidden" name="quote" value="1">
              <textarea class="s-textarea" id="comment_inputor" name="content" event-node="mini_editor_textarea" hidefocus="true" model-args='t=comment'></textarea>
           
            <div class="action clearfix">
              <div class="acts">

                  <a event-node="insert_face" class="face-block" href="javascript:;" title="表情"><img height="28" class="icons" src="{:APPS_URL}/w3g/_static/images/ico_face.png"></a>

                  <a href="javascript:void(0);" class="image-block"><img height="28" class="icons" src="{:APPS_URL}/w3g/_static/images/ico_photo.png">
						    <input type="file" name="image_ids" inputname='image' onchange="core.plugInit('uploadFile',this,'','image')" urlquery='attach_type=feed_image&upload_type=image&thumb=1&width=100&height=100&cut=1' hidefocus="true">
						    </a><span class="f10">可多次上传图片</span>

              </div>
              <div class="pb">
                <ul class="img_list" id="img_list">
                </ul>
              </div>
              <div class="clear"></div>
              <div model-node="faceDiv"></div>
            </div> </div>
          </dd>
        </dl>
      </div>
      <div class="form_btn"><a type="submit" class="btn" onClick="replySubmit();"  value="发表" id="send_reply" style="width:100%;">发表</a></div>
    </form>
    <php>} elseif($mid) {</php>
    <div class="li mt10 clearfix">
      <form method="post" action="{:U('group/Topic/post')}" id="replyForm">
        <div>
          <div style="padding:0 0 10px 0; color:#555; text-align:center;">本贴已锁定暂时不能回复</div>
        </div>
      </form>
    </div>
    <php>} else {</php>
    <div class="li mt10 clearfix">
      <form method="post" action="{:U('group/Topic/post')}" id="replyForm">
        <div>
          <div style="padding:0 0 10px 0; color:#555; text-align:center;">登录后才能回复，点击<a href="{:U('w3g/Public/login')}">进入登录</a></div>
        </div>
      </form>
    </div>
    <php>}</php>
    <!-- 回复 end--> 
    
  </div>
</div>
<include file="../Public/footer" /> 

<script type="text/javascript">
// 过滤html，字串检测长度
function checkPostContent(content)
{
	content = content.replace(/&nbsp;/g, "");
	content = content.replace(/<br>/g, "");
	content = content.replace(/<p>/g, "");
	content = content.replace(/<\/p>/g, "");
	return getLength(content);
}

function replySubmit() {
	var content = $('#comment_inputor').val();
    content = removeHTMLTag(content);
	if(checkPostContent(content) < 10) {
		$.ui.showMask('回复内容不能小于10个字', true);
		return false;
	}else{
	    $("#replyForm").submit();
	}
}

</script> 